package com.et114.components.simpletable;


public class FooterFactory {
	public static String	NORMAL			= "normal";
	public static String	SIMPLE			= "simple";
	public static String	ONLY_REDIRECT	= "onlyRedirect";
	public static String	ONLY_NEXT		= "onlyNext";
	public static String	CHINA			= "cn";
	public static String	English			= "en";
	
	private DefaultFooter footer;

	private FooterFactory ( DataList pageInfo , String showSummary , String fromname , String language ) {
		if ( language.equals( CHINA ) )
			footer = new CnFooter( pageInfo, fromname, showSummary );
		else if ( language.equals( English ) )
			footer = new EnFooter( pageInfo, fromname, showSummary );
		else
			footer = new DefaultFooter( pageInfo, fromname, showSummary );

	}

	public static FooterFactory getInstance ( DataList pageInfo ,
			String showSummary , String formname , String language ) {
		return new FooterFactory( pageInfo, showSummary, formname, language );
	}

	public String getFooter ( String style ) {
		if ( style == null || style.equals( "" ) || style.equals( NORMAL ) )
			return footer.getNormal();
		if ( style.equals( SIMPLE ) )
			return footer.getSimple();
		if ( style.equals( ONLY_REDIRECT ) )
			return footer.getOnlyRedirect();
		if ( style.equals( ONLY_NEXT ) )
			return footer.getOnlyNext();

		return "";
	}

}
